package cz.via.wowss.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
//@IdClass(Shareholder.class)
@Table(name = "SHAREHOLDER")
public class Shareholder {

	@Id
	@ManyToOne
	@JoinColumn(name = "PLAYER_ID", nullable = false)
	private Player player;

	@Id
	@ManyToOne
	@JoinColumn(name = "COMPANY_ID", nullable = false)
	private Company company;

	@Column(name = "STOCK_COUNT", nullable = false)
	private Integer stockCount;

	public Player getPlayer() {
		return player;
	}

	public void setPlayer(Player player) {
		this.player = player;
	}

	public Company getCompany() {
		return company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

	public Integer getStockCount() {
		return stockCount;
	}

	public void setStockCount(Integer stockCount) {
		this.stockCount = stockCount;
	}
}
